package com.example.demo.api.factory;

import com.example.demo.api.RemoteStorageService;
import feign.hystrix.FallbackFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;

@Component
public class RemoteStorageFallbackFactory implements FallbackFactory<RemoteStorageService> {
    @Override
    public RemoteStorageService create(Throwable throwable) {
        return new RemoteStorageService() {
            @Override
            public ResponseEntity deduct(String commodityCode, int count) {
                return null;
            }
        };
    }
}
